import http from "../utils/http";

// 获取所有项目
export const getAllProjectsService = (params) => {
  return http.get("/project/allproject", params);
};

// 根据学校获取项目
export const getProjectsBySchoolService = (params) => {
  return http.get("/project/allproject", params);
};

// 根据项目ID获取学校信息
export const getSchoolByIdService = (id) => {
  return http.get(`/school/getSchoolById/${id}`);
};

// 搜索项目
export const searchProjectsService = (params) => {
  return http.post("/project/queryProjectByIntroduce", params);
};

// 增加项目阅读量
export const increaseProjectReadCountService = (projectId) => {
  return http.get(`/project/lookproject/${projectId}`);
};

// 创建项目
export const createProjectService = (data) => {
  return http.post("/project/create", data);
};

// 获取用户信息
export const getUserInfoService = () => {
  return http.get("/user/getuserinfo");
};

// 查询申请的项目
export const queryApplicationProjectService = (params) => {
  return http.get("/project/queryApplicationProject", params);
};

// 查询项目列表
export const queryProjectService = (params) => {
  return http.get("/project/queryProject", params);
};



// 获取项目详情
export const getProjectByIdService = (projectId) => {
  return http.get(`/project/projectById/${projectId}`);
};

// 增加项目阅读量
export const increaseProjectViewCountService = (projectId) => {
  return http.get(`/project/lookproject/${projectId}`);
};

// 投递项目
export const joinProjectService = (projectId, data) => {
  return http.post(`/project/join/${projectId}`, data);
};